package com.kl.forum.service;

import com.kl.forum.dao.ArticleLightMapper;
import com.kl.forum.entity.ArticleLight;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ArticleLightService {
    @Autowired
    private ArticleLightMapper articleLightMapper;

    public int insertSelective(ArticleLight articleLight){
       return   articleLightMapper.insertSelective(articleLight);
    }
    public ArticleLight findLightRecord(Integer articleId,Integer userId){
        Map map=new HashMap();
        map.put("articleId",articleId);
        map.put("userId",userId);
        return  articleLightMapper.findLightRecord(map);
    }
    public int update(ArticleLight articleLight){
        return  articleLightMapper.updateByPrimaryKeySelective(articleLight);
    }
}
